#ifndef STRUCT_H
#define STRUCT_H

#include "EngineApi.h"
#include <d3dx9.h>

enum PRIM_TYPE
{
   POINT_LIST     = D3DPT_POINTLIST,
   LINE_LIST      = D3DPT_LINELIST,
   LINE_STRIP     = D3DPT_LINESTRIP,
   TRIANGLE_LIST  = D3DPT_TRIANGLELIST,
   TRIANGLE_STRIP = D3DPT_TRIANGLESTRIP,
   TRIANGLE_FAN   = D3DPT_TRIANGLEFAN,
};

enum MatrixMode
{
   WORLD      = D3DTS_WORLD,
   VIEW       = D3DTS_VIEW,
   PROJECTION = D3DTS_PROJECTION,
};

/*-------------------------------< Vertices >----------------------------------------------*/
#define FVF_COLORVERTEX D3DFVF_XYZ | D3DFVF_DIFFUSE

struct ENGINE_API Vertex
{
   float x, y, z;
};

struct ENGINE_API ColorVertex : public Vertex
{
   DWORD color;

   void setVertex( float x, float y, float z, DWORD color ) 
   {
      this->x = x;
      this->y = y;
      this->z = z;
     
      this->color = color;
   }
};


#define FVF_TEXTUREVERTEX D3DFVF_XYZ | D3DFVF_TEX1

struct ENGINE_API TextureVertex : public Vertex  
{
   float u, v;

   void setVertex( float x, float y, float z, float u, float v ) 
   {
      this->x = x;
      this->y = y;
      this->z = z;

      this->u = u;
      this->v = v;
   }
};

#define FVF_NORMAL_VERTEX D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE

struct ENGINE_API NormalVertex : public Vertex
{
   //normal
   float nx, ny, nz;

   DWORD color;

   void setVertex( float x, float y, float z, float nx, float ny, float nz, DWORD color) 
   {
      this->x = x;
      this->y = y;
      this->z = z;
      
      this->nx = nx;
      this->ny = ny;
      this->nz = nz;

      this->color = color;
   }
};


#define FVF_NORMAL_TEXTURED_VERTEX D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1

struct ENGINE_API NormalTexturedVertex : public Vertex
{
   //normal
   float nx, ny, nz;

   //texture
   float u, v;

   void setVertex( float x, float y, float z, float nx, float ny, float nz, float u, float v ) 
   {
      this->x = x;
      this->y = y;
      this->z = z;

      this->nx = nx;
      this->ny = ny;
      this->nz = nz;

      this->u = u;
      this->v = v;
   }
};


#define FVF_SUPER_VERTEX D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE | D3DFVF_TEX1

struct ENGINE_API SuperVertex : public Vertex
{
   //normal
   float nx, ny, nz;

   //color
   DWORD color;

   //texture
   float u, v;

   

   void setVertex( float x, float y, float z, float nx, float ny, float nz, float u, float v, DWORD color) 
   {
      this->x = x;
      this->y = y;
      this->z = z;

      this->nx = nx;
      this->ny = ny;
      this->nz = nz;

      this->u = u;
      this->v = v;

      this->color = color;
   }
};


// aeosdk1
#endif//STRUCT_H